package org.example.datastream.test.custom;

import java.io.Serializable;

public class RecordLog<T> implements Serializable {

    /**
     * 表名（去除分表数字）
     */
    private String table;

    /**
     * 数据库操作
     * INSERT/UPDATE/DELETE
     */
    private String opt;

    /**
     * 数据库主键名称
     */
    private String pk;

    /**
     * 数据库主键值
     */
    private String pkv;

    /**
     * 数据项
     */
    private T record;

    public RecordLog() {
    }

    public RecordLog(String table, String opt, String pk, String pkv, T record) {
        this.table = table;
        this.opt = opt;
        this.pk = pk;
        this.pkv = pkv;
        this.record = record;
    }

    public String getTable() {
        return table;
    }

    public void setTable(String table) {
        this.table = table;
    }

    public String getOpt() {
        return opt;
    }

    public void setOpt(String opt) {
        this.opt = opt;
    }

    public String getPk() {
        return pk;
    }

    public void setPk(String pk) {
        this.pk = pk;
    }

    public String getPkv() {
        return pkv;
    }

    public void setPkv(String pkv) {
        this.pkv = pkv;
    }

    public T getRecord() {
        return record;
    }

    public void setRecord(T record) {
        this.record = record;
    }

    @Override
    public String toString() {
        return "RecordLog{" +
                "table='" + table + '\'' +
                ", opt='" + opt + '\'' +
                ", pk='" + pk + '\'' +
                ", pkv='" + pkv + '\'' +
                ", record=" + record +
                '}';
    }
}
